package sysint;

public class FlightJsonToXML {
	public String flightsToXML(String flights){
		
		flights = flights.replaceFirst("<entry>", "<Flight>");
		flights = flights.replaceFirst("</entry>", "</Flight>");
		
		flights = flights.replaceFirst("<list>", "<Parameters>");
		flights = flights.replaceFirst("</list>", "</Parameters>");
		
		flights = flights.replaceFirst("<string>", "<FlightCode2>");
		flights = flights.replaceFirst("</string>", "</FlightCode2>");
		
		flights = flights.replaceFirst("<string>", "<Hexcode>");
		flights = flights.replaceFirst("</string>", "</Hexcode>");
		
		flights = flights.replaceFirst("<double>", "<Latidude>");
		flights = flights.replaceFirst("</double>", "</Latidude>");
		
		flights = flights.replaceFirst("<double>", "<Longitude>");
		flights = flights.replaceFirst("</double>", "</Longitude>");
		
		flights = flights.replaceFirst("<string>", "<Track>");
		flights = flights.replaceFirst("</string>", "</Track>");
		
		flights = flights.replaceFirst("<string>", "<Altitude>");
		flights = flights.replaceFirst("</string>", "</Altitude>");
		
		flights = flights.replaceFirst("<string>", "<Speed>");
		flights = flights.replaceFirst("</string>", "</Speed>");
		
		flights = flights.replaceFirst("<string>", "<Squawk>");
		flights = flights.replaceFirst("</string>", "</Squawk>");
		
		flights = flights.replaceFirst("<string>", "<RadarType>");
		flights = flights.replaceFirst("</string>", "</RadarType>");
		
		flights = flights.replaceFirst("<string>", "<PlaneType>");
		flights = flights.replaceFirst("</string>", "</PlaneType>");
		
		flights = flights.replaceFirst("<string>", "<FlugzeugID>");
		flights = flights.replaceFirst("</string>", "</FlugzeugID>");
		
		flights = flights.replaceFirst("<int>", "<UnixTimestamp>");
		flights = flights.replaceFirst("</int>", "</UnixTimestamp>");
		
		flights = flights.replaceFirst("<string>", "<From>");
		flights = flights.replaceFirst("</string>", "</From>");
		
		flights = flights.replaceFirst("<string>", "<To>");
		flights = flights.replaceFirst("</string>", "</To>");
		
		return flights;
    }
}
